Integrand size = 31, antiderivative size = 141 \[ \int \frac {(a+a \cos (c+d x)) (A+B \cos (c+d x))}{\sqrt {\sec (c+d x)}} \, dx=\frac {2 a (5 A+3 B) \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{5 d}+\frac {2 a (A+B) \sqrt {\cos (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right ) \sqrt {\sec (c+d x)}}{3 d}+\frac {2 a B \sin (c+d x)}{5 d \sec ^{\frac {3}{2}}(c+d x)}+\frac {2 a (A+B) \sin (c+d x)}{3 d \sqrt {\sec (c+d x)}} \]
[Out]
Time = 0.21 (sec) , antiderivative size = 141, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.226, Rules used = {3039, 4081, 3872, 3854, 3856, 2720, 2719} \[ \int \frac {(a+a \cos (c+d x)) (A+B \cos (c+d x))}{\sqrt {\sec (c+d x)}} \, dx=\frac {2 a (A+B) \sin (c+d x)}{3 d \sqrt {\sec (c+d x)}}+\frac {2 a (A+B) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )}{3 d}+\frac {2 a (5 A+3 B) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{5 d}+\frac {2 a B \sin (c+d x)}{5 d \sec ^{\frac {3}{2}}(c+d x)} \]
[In]
[Out]
Rule 2719
Rule 2720
Rule 3039
Rule 3854
Rule 3856
Rule 3872
Rule 4081
Rubi steps \begin{align*} \text {integral}& = \int \frac {(a+a \sec (c+d x)) (B+A \sec (c+d x))}{\sec ^{\frac {5}{2}}(c+d x)} \, dx \\ & = \frac {2 a B \sin (c+d x)}{5 d \sec ^{\frac {3}{2}}(c+d x)}-\frac {2}{5} \int \frac {-\frac {5}{2} a (A+B)-\frac {1}{2} a (5 A+3 B) \sec (c+d x)}{\sec ^{\frac {3}{2}}(c+d x)} \, dx \\ & = \frac {2 a B \sin (c+d x)}{5 d \sec ^{\frac {3}{2}}(c+d x)}+(a (A+B)) \int \frac {1}{\sec ^{\frac {3}{2}}(c+d x)} \, dx+\frac {1}{5} (a (5 A+3 B)) \int \frac {1}{\sqrt {\sec (c+d x)}} \, dx \\ & = \frac {2 a B \sin (c+d x)}{5 d \sec ^{\frac {3}{2}}(c+d x)}+\frac {2 a (A+B) \sin (c+d x)}{3 d \sqrt {\sec (c+d x)}}+\frac {1}{3} (a (A+B)) \int \sqrt {\sec (c+d x)} \, dx+\frac {1}{5} \left (a (5 A+3 B) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \sqrt {\cos (c+d x)} \, dx \\ & = \frac {2 a (5 A+3 B) \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{5 d}+\frac {2 a B \sin (c+d x)}{5 d \sec ^{\frac {3}{2}}(c+d x)}+\frac {2 a (A+B) \sin (c+d x)}{3 d \sqrt {\sec (c+d x)}}+\frac {1}{3} \left (a (A+B) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {1}{\sqrt {\cos (c+d x)}} \, dx \\ & = \frac {2 a (5 A+3 B) \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{5 d}+\frac {2 a (A+B) \sqrt {\cos (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right ) \sqrt {\sec (c+d x)}}{3 d}+\frac {2 a B \sin (c+d x)}{5 d \sec ^{\frac {3}{2}}(c+d x)}+\frac {2 a (A+B) \sin (c+d x)}{3 d \sqrt {\sec (c+d x)}} \\ \end{align*}
Result contains higher order function than in optimal. Order 5 vs. order 4 in optimal.
Time = 1.60 (sec) , antiderivative size = 148, normalized size of antiderivative = 1.05 \[ \int \frac {(a+a \cos (c+d x)) (A+B \cos (c+d x))}{\sqrt {\sec (c+d x)}} \, dx=\frac {a \sqrt {\sec (c+d x)} \left (10 (A+B) \sqrt {\cos (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )-2 i (5 A+3 B) e^{i (c+d x)} \sqrt {1+e^{2 i (c+d x)}} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {3}{4},\frac {7}{4},-e^{2 i (c+d x)}\right )+\cos (c+d x) (6 i (5 A+3 B)+10 (A+B) \sin (c+d x)+3 B \sin (2 (c+d x)))\right )}{15 d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(354\) vs. \(2(173)=346\).
Time = 10.19 (sec) , antiderivative size = 355, normalized size of antiderivative = 2.52
method | result | size |
default | \(-\frac {2 \sqrt {\left (2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, a \left (-24 B \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\sin ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (20 A +44 B \right ) \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\left (-10 A -16 B \right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+5 A \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, F\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )-15 A \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )+5 B \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, F\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )-9 B \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )\right )}{15 \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, d}\) | \(355\) |
parts | \(\frac {2 a A \sqrt {\left (2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+1}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )}{\sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, d}-\frac {2 \left (a A +B a \right ) \sqrt {\left (2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (4 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, F\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )\right )}{3 \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, d}-\frac {2 B a \sqrt {\left (2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (-8 \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\sin ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+8 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-3 \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )\right )}{5 \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, d}\) | \(524\) |
[In]
[Out]
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 0.10 (sec) , antiderivative size = 169, normalized size of antiderivative = 1.20 \[ \int \frac {(a+a \cos (c+d x)) (A+B \cos (c+d x))}{\sqrt {\sec (c+d x)}} \, dx=\frac {-5 i \, \sqrt {2} {\left (A + B\right )} a {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) + 5 i \, \sqrt {2} {\left (A + B\right )} a {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) + 3 i \, \sqrt {2} {\left (5 \, A + 3 \, B\right )} a {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right )\right ) - 3 i \, \sqrt {2} {\left (5 \, A + 3 \, B\right )} a {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right )\right ) + \frac {2 \, {\left (3 \, B a \cos \left (d x + c\right )^{2} + 5 \, {\left (A + B\right )} a \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{\sqrt {\cos \left (d x + c\right )}}}{15 \, d} \]
[In]
[Out]
\[ \int \frac {(a+a \cos (c+d x)) (A+B \cos (c+d x))}{\sqrt {\sec (c+d x)}} \, dx=a \left (\int \frac {A}{\sqrt {\sec {\left (c + d x \right )}}}\, dx + \int \frac {A \cos {\left (c + d x \right )}}{\sqrt {\sec {\left (c + d x \right )}}}\, dx + \int \frac {B \cos {\left (c + d x \right )}}{\sqrt {\sec {\left (c + d x \right )}}}\, dx + \int \frac {B \cos ^{2}{\left (c + d x \right )}}{\sqrt {\sec {\left (c + d x \right )}}}\, dx\right ) \]
[In]
[Out]
\[ \int \frac {(a+a \cos (c+d x)) (A+B \cos (c+d x))}{\sqrt {\sec (c+d x)}} \, dx=\int { \frac {{\left (B \cos \left (d x + c\right ) + A\right )} {\left (a \cos \left (d x + c\right ) + a\right )}}{\sqrt {\sec \left (d x + c\right )}} \,d x } \]
[In]
[Out]
\[ \int \frac {(a+a \cos (c+d x)) (A+B \cos (c+d x))}{\sqrt {\sec (c+d x)}} \, dx=\int { \frac {{\left (B \cos \left (d x + c\right ) + A\right )} {\left (a \cos \left (d x + c\right ) + a\right )}}{\sqrt {\sec \left (d x + c\right )}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {(a+a \cos (c+d x)) (A+B \cos (c+d x))}{\sqrt {\sec (c+d x)}} \, dx=\int \frac {\left (A+B\,\cos \left (c+d\,x\right )\right )\,\left (a+a\,\cos \left (c+d\,x\right )\right )}{\sqrt {\frac {1}{\cos \left (c+d\,x\right )}}} \,d x \]
[In]
[Out]